#ifndef __MODULARITY_MAT
#define __MODULARITY_MAT
#include "../sparse_mlpl/sparse_matrix.h"

int Free2dimensionalArray(elem **arr, int iLength);
 /*creates B[g]*/
int CreateModularityMat(sparse_matrix_lst* A, int* Group, int iGroupSize,elem*** ModMat_ptr, int** VertexDegrees_ptr, int* M);
 /*creates B^[g]*/
int CreateGeneralizedModMat(elem** B_g,int* Group,int iGroupSize, elem*** GnrModMat_ptr, elem** F_g_ptr);
 /*derive A[g] sparse mtx from A*/
int GetAgFromA(sparse_matrix_lst *A, sparse_matrix_lst** A_g_ptr, int *Group, int iGroupSize);
 /*free mem functions to be called if an error occurs*/
void FreeMem1(	elem **GnrModMat,elem **ModMat,int *GroupVertexDegrees, int *Group,elem* F_g, sparse_matrix_lst *A,sparse_matrix_lst *A_g, int iGroupSize);
 /*free mem functions to be called if an error occurs*/
void FreeMem2(cell_t* row_pointer, cell_t* CurrentCell, cell_t* tmp_cell, cell_t** GroupColsTails, int iGroupSize);

#endif /*__MODULARITY_MAT*/